package controller;

import java.sql.Timestamp;

import model.AppModel;
import model.Email;
import view.AppView;

public class PreviewController {

	// Application model and view
	private AppModel model;
	private AppView view;
	
	public PreviewController(AppModel model, AppView view) {
		this.model = model;
		this.view = view;
	}
	
	/**
	 * Set the Email object to preview in the PreviewView pane
	 * @param emailObj
	 * @return
	 */
	public void setEmailObject(Email email) {

		view.getPreview().setTo(email.getTo());
		view.getPreview().setFrom(email.getFrom());
		view.getPreview().setSubject(email.getSubject());
		view.getPreview().setBody(email.getBody());
		view.getPreview().setDate(email.getTimestamp());
	}

}
